﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Data;

namespace Bussiness
{
    public static class ControladoraLogin
    {
        public static Usuario Login (string user, string password)
        {
            using (dbOttado db = new dbOttado())
            {
                Usuario result = null;
                var Usuario = from u in db.Usuario
                              where u.usuario == user && u.password == password
                              select u;
                if (Usuario.Count() > 0) result = Usuario.FirstOrDefault();
                return result;
            }
        }
    }
}
